package com.neoCalf.neoCommon.enums;


import com.neoCalf.neoCommon.utils.DataTool;
import lombok.Getter;


@Getter
public enum JoinTypeEnum {
    JOIN(0, "直接加入"),
    APPLY(1, "需要同意");
    private final int joinType;
    private final String description;

    JoinTypeEnum(int joinType, String description) {
        this.joinType = joinType;
        this.description = description;
    }

    public static JoinTypeEnum getByType(Integer joinType) {
        if (DataTool.isNull(joinType)) {
            return null;
        }
        for (JoinTypeEnum typeEnum : JoinTypeEnum.values()) {
            if (joinType.equals(typeEnum.getJoinType())) {
                return typeEnum;
            }
        }
        return null;
    }
}
